/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.mapperv2.provider;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.taobao.ibatiside.model.common.provider.IbatisCommonProvider;
import org.taobao.ibatiside.model.mapperv2.DocumentRoot;
import org.taobao.ibatiside.model.mapperv2.Mapperv2Factory;
import org.taobao.ibatiside.model.mapperv2.Mapperv2Package;

/**
 * This is the item provider adapter for a {@link org.taobao.ibatiside.model.mapperv2.DocumentRoot} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class DocumentRootItemProvider
	extends IbatisCommonProvider
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DocumentRootItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

		}
		return itemPropertyDescriptors;
	}

	/**
	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
		if (childrenFeatures == null) {
			super.getChildrenFeatures(object);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__CACHE_MODEL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__DELETE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__DISCRIMINATOR);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__DYNAMIC);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__FLUSH_INTERVAL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__FLUSH_ON_EXECUTE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__INCLUDE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__INSERT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_EMPTY);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_EQUAL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_GREATER_EQUAL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_GREATER_THAN);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_LESS_EQUAL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_LESS_THAN);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_EMPTY);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_EQUAL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_NULL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_PARAMETER_PRESENT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_PROPERTY_AVAILABLE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NULL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_PARAMETER_PRESENT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_PROPERTY_AVAILABLE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__ITERATE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__PARAMETER);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__PARAMETER_MAP);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__PROCEDURE);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__PROPERTY);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__RESULT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__RESULT_MAP);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__SELECT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__SELECT_KEY);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__SQL);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__SQL_MAP);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__STATEMENT);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__SUB_MAP);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__TYPE_ALIAS);
			childrenFeatures.add(Mapperv2Package.Literals.DOCUMENT_ROOT__UPDATE);
		}
		return childrenFeatures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EStructuralFeature getChildFeature(Object object, Object child) {
		// Check the type of the specified child object and return the proper feature to use for
		// adding (see {@link AddCommand}) it as a child.

		return super.getChildFeature(object, child);
	}

	/**
	 * This returns DocumentRoot.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/DocumentRoot"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		return getString("_UI_DocumentRoot_type");
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(DocumentRoot.class)) {
			case Mapperv2Package.DOCUMENT_ROOT__CACHE_MODEL:
			case Mapperv2Package.DOCUMENT_ROOT__DELETE:
			case Mapperv2Package.DOCUMENT_ROOT__DISCRIMINATOR:
			case Mapperv2Package.DOCUMENT_ROOT__DYNAMIC:
			case Mapperv2Package.DOCUMENT_ROOT__FLUSH_INTERVAL:
			case Mapperv2Package.DOCUMENT_ROOT__FLUSH_ON_EXECUTE:
			case Mapperv2Package.DOCUMENT_ROOT__INCLUDE:
			case Mapperv2Package.DOCUMENT_ROOT__INSERT:
			case Mapperv2Package.DOCUMENT_ROOT__IS_EMPTY:
			case Mapperv2Package.DOCUMENT_ROOT__IS_EQUAL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_GREATER_EQUAL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_GREATER_THAN:
			case Mapperv2Package.DOCUMENT_ROOT__IS_LESS_EQUAL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_LESS_THAN:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NOT_EMPTY:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NOT_EQUAL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NOT_NULL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NOT_PARAMETER_PRESENT:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NOT_PROPERTY_AVAILABLE:
			case Mapperv2Package.DOCUMENT_ROOT__IS_NULL:
			case Mapperv2Package.DOCUMENT_ROOT__IS_PARAMETER_PRESENT:
			case Mapperv2Package.DOCUMENT_ROOT__IS_PROPERTY_AVAILABLE:
			case Mapperv2Package.DOCUMENT_ROOT__ITERATE:
			case Mapperv2Package.DOCUMENT_ROOT__PARAMETER:
			case Mapperv2Package.DOCUMENT_ROOT__PARAMETER_MAP:
			case Mapperv2Package.DOCUMENT_ROOT__PROCEDURE:
			case Mapperv2Package.DOCUMENT_ROOT__PROPERTY:
			case Mapperv2Package.DOCUMENT_ROOT__RESULT:
			case Mapperv2Package.DOCUMENT_ROOT__RESULT_MAP:
			case Mapperv2Package.DOCUMENT_ROOT__SELECT:
			case Mapperv2Package.DOCUMENT_ROOT__SELECT_KEY:
			case Mapperv2Package.DOCUMENT_ROOT__SQL:
			case Mapperv2Package.DOCUMENT_ROOT__SQL_MAP:
			case Mapperv2Package.DOCUMENT_ROOT__STATEMENT:
			case Mapperv2Package.DOCUMENT_ROOT__SUB_MAP:
			case Mapperv2Package.DOCUMENT_ROOT__TYPE_ALIAS:
			case Mapperv2Package.DOCUMENT_ROOT__UPDATE:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__CACHE_MODEL,
				 Mapperv2Factory.eINSTANCE.createCacheModel()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__DELETE,
				 Mapperv2Factory.eINSTANCE.createDelete()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__DISCRIMINATOR,
				 Mapperv2Factory.eINSTANCE.createDiscriminator()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__DYNAMIC,
				 Mapperv2Factory.eINSTANCE.createDynamic()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__FLUSH_INTERVAL,
				 Mapperv2Factory.eINSTANCE.createFlushInterval()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__FLUSH_ON_EXECUTE,
				 Mapperv2Factory.eINSTANCE.createFlushOnExecute()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__INCLUDE,
				 Mapperv2Factory.eINSTANCE.createInclude()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__INSERT,
				 Mapperv2Factory.eINSTANCE.createInsert()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_EMPTY,
				 Mapperv2Factory.eINSTANCE.createIsEmpty()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_EQUAL,
				 Mapperv2Factory.eINSTANCE.createIsEqual()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_GREATER_EQUAL,
				 Mapperv2Factory.eINSTANCE.createIsGreaterEqual()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_GREATER_THAN,
				 Mapperv2Factory.eINSTANCE.createIsGreaterThan()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_LESS_EQUAL,
				 Mapperv2Factory.eINSTANCE.createIsLessEqual()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_LESS_THAN,
				 Mapperv2Factory.eINSTANCE.createIsLessThan()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_EMPTY,
				 Mapperv2Factory.eINSTANCE.createIsNotEmpty()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_EQUAL,
				 Mapperv2Factory.eINSTANCE.createIsNotEqual()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_NULL,
				 Mapperv2Factory.eINSTANCE.createIsNotNull()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_PARAMETER_PRESENT,
				 Mapperv2Factory.eINSTANCE.createIsNotParameterPresent()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NOT_PROPERTY_AVAILABLE,
				 Mapperv2Factory.eINSTANCE.createIsNotPropertyAvailable()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_NULL,
				 Mapperv2Factory.eINSTANCE.createIsNull()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_PARAMETER_PRESENT,
				 Mapperv2Factory.eINSTANCE.createIsParameterPresent()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__IS_PROPERTY_AVAILABLE,
				 Mapperv2Factory.eINSTANCE.createIsPropertyAvailable()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__ITERATE,
				 Mapperv2Factory.eINSTANCE.createIterate()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__PARAMETER,
				 Mapperv2Factory.eINSTANCE.createParameter()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__PARAMETER_MAP,
				 Mapperv2Factory.eINSTANCE.createParameterMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__PROCEDURE,
				 Mapperv2Factory.eINSTANCE.createProcedure()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__PROPERTY,
				 Mapperv2Factory.eINSTANCE.createProperty()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__RESULT,
				 Mapperv2Factory.eINSTANCE.createResult()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__RESULT_MAP,
				 Mapperv2Factory.eINSTANCE.createResultMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__SELECT,
				 Mapperv2Factory.eINSTANCE.createSelect()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__SELECT_KEY,
				 Mapperv2Factory.eINSTANCE.createSelectKey()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__SQL,
				 Mapperv2Factory.eINSTANCE.createSql()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__SQL_MAP,
				 Mapperv2Factory.eINSTANCE.createSqlMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__STATEMENT,
				 Mapperv2Factory.eINSTANCE.createStatement()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__SUB_MAP,
				 Mapperv2Factory.eINSTANCE.createSubMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__TYPE_ALIAS,
				 Mapperv2Factory.eINSTANCE.createTypeAlias()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv2Package.Literals.DOCUMENT_ROOT__UPDATE,
				 Mapperv2Factory.eINSTANCE.createUpdate()));
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return Map2xEditPlugin.INSTANCE;
	}

}
